package com.gorkr.clientdemo1.controller;

import com.gorkr.clientdemo1.clients.FeignTestClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gorkr
 * @date 2022/06/25 09:57
 **/

@RestController
@RequestMapping("feign-test")
@Slf4j
public class FeignTestController {

    @Autowired
    private FeignTestClient feignTestClient;

    @GetMapping("/{id}")
    public String test(@PathVariable("id") Integer id){

        log.info("feignTestController:/feign-test/{}",id);

        String test = feignTestClient.test(id);
        return test;
    }
}
    